package sethomework;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class set1 {
    public static void main(String[] args) {
        Set<String> set = new HashSet<>();
        set.add("刘备");
        set.add("关羽");
        set.add("张飞");
        set.add("刘备");

        set.add("张飞");
        Iterator<String> iterator = set.iterator();
        while (iterator.hasNext()) {
            String next =  iterator.next();
            System.out.println(next);

        }
    }
}
